import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Index1Page from '@/views/index1Page.vue'
import Index2Page from '@/views/index2Page.vue'
import MarqueePage from '@/views/marqueePage.vue'
import TodoList from '@/views/todoList.vue'
import calculateTheListener from '@/views/calculateTheListener.vue'
import GetTheElement from '@/views/getTheElement.vue'
import toRefsPage from '@/views/toRefsPage.vue'
import CombinedApi from '@/views/combinedApi.vue'
import pageA from '@/views/pageA.vue'
import pageB from '@/views/pageB.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue'),
    },
    {
      path:'/index1',
      component:Index1Page
    },
    {
      path:'/index2',
      component:Index2Page
    },
    {
      path:'/marquee',
      component:MarqueePage
    },
    {
      path:'/todolist',
      component:TodoList
    },
    {
      path:'/calculate',
      component:calculateTheListener
    },
    {
      path:'/get',
      component:GetTheElement
    },
    {
      path:'/toRefs',
      component:toRefsPage
    },
    {
      path:'/combinedApi',
      component:CombinedApi
    },
    {
      path: '/pageA',
      component: pageA
    },
    {
      path: '/pageB/:id',
      // path: '/pageB',
      name:'pageB',
      component: pageB
    }
  ],
})

export default router
